package Test;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;

import junit.framework.TestCase;

import com.sun.tools.javac.tree.Tree.Assert;

import database.Database;


public class DatabaseTest extends TestCase {
	Database testDB = new Database();
	String newFirstName = "testen";
	String newLastName = "test";
	String newUserName = "testtest";
	String newpassword = "tete";
	String newEmail = "test";
	int newPhonenumber = 12345678;
	Date newDateOfBirth = new Date(1989,05,03);
	String newTitle = "Tittel";
	String newDate = "2011.04,05";
	String newFromPointOfTime = "14:00";
	String newToPointOfTime = "16:00";
	String newLocation = "plassen";
	int newUserID = 911;
	
<<<<<<< .mine
	public void testConnect
	
	
	public void testAddUser(){
		boolean addedUser = true;
		
		addedUser = testDB.addUser(newFirstName, newLastName, newUserName, newpassword, newEmail, newPhonenumber, newDateOfBirth);
		assertTrue(addedUser);
		
	
	}
	public void testAddAppointment(){
		testDB.addAppointment(newTitle, newDate, newFromPointOfTime,  newToPointOfTime, newLocation, newUserID);
		
		assertTrue(testDB.customerExists(phoneNumber));
		ResultSet testResultSet = testDB.getCustomerIDFromCustomerName(newName, newSurName);
		ArrayList<String> testList = restulSetArray.ResultSetToArrayList(testResultSet);
		tempCustomerID = testList.get(0);
		boolean customerExsits = false;
		if (Integer.parseInt(tempCustomerID) > 0){
			customerExsits = true;
		}
		assertTrue(customerExsits);
	}
=======
	
>>>>>>> .r158

}
